import './assets/main.css'
// if you just want to import css
import 'element-plus/theme-chalk/dark/css-vars.css'
import { createApp } from 'vue'
import { createPinia } from 'pinia'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import axios from './utils/axios'
import App from './App.vue'
import router from './router'

import VxeUIAll from 'vxe-pc-ui'
import 'vxe-pc-ui/es/style.css'

import VxeUITable from 'vxe-table'
import 'vxe-table/es/style.css'

// 引入epic-designer样式
import 'epic-designer/dist/style.css'
import { setupElementPlus } from 'epic-designer/dist/ui/elementPlus'

// 注册Element UI
setupElementPlus()

let pinia = createPinia()

const app = createApp(App)
app.use(pinia)
app.use(router)
app.use(ElementPlus)

app.use(VxeUIAll).use(VxeUITable)
window.$axios = axios
app.mount('#app')

if (window.api && window.api.onNavigate) {
  window.api.onNavigate((data) => {
    console.log('来自主进程的数据:', data)
    router.push(data)
  })
} else {
  console.warn('window.api is not available or onNavigate is not defined')
}
